<style lang="less" scoped>
@import url('./style.less');
</style>
<template>
  <div class="box">
    <div class="box-title" @click="show=!show">
      <div class="box-title__label">历史地址</div>
      <div class="box-title__right">
        <span class="num">{{len||'无'}}</span>
        <i :class="cls"></i>
      </div>
    </div>
    <div class="box-content" v-show="show">
      <div class="panel">
        <div class="panel-content" v-if="len>0">
          <div class="step" v-for="(item, index) in dt" :key="index">
            <div :class="['step-content',{active:index==0}]">
              <div class="step-item">
                <div class="step-label">{{item.ChangeDate||'-'}}</div>
                <div class="step-value" @click="__getMap__(item.Address)">{{item.Address||'-'}}</div>
              </div>
              <div class="step-arrow">
                <i class="iconfont icon-more"></i>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: ['dt'],
  data() {
    return {
      show: false
    };
  },
  onUnload() {
    this.show = false;
  },
  computed: {
    cls() {
      const arrow = this.show ? 'icon-shangjiantou' : 'icon-tubiaozhizuo-';
      return `iconfont ${arrow}`;
    },
    len() {
      let tmp = 0;
      try {
        tmp = this.dt.length;
      } catch (error) {}
      return tmp;
    }
  },
  methods: {}
};
</script>
